<template>
  <div v-if="dialogData">
    <el-dialog title="手动调整" :visible="showDialog" @close="close">
      <el-form ref="manaulForm" :model="formData" :rules="rules" label-width="80px">
        <el-form-item label="任务编号">
          <el-input v-model="formData.id" />
        </el-form-item>
        <el-form-item label="运单数量">
          <el-input v-model="formData.transportNum" />
        </el-form-item>
        <el-form-item label="选择车次">
          <el-select v-model="formData.transportTripsId" style="width:100%">
            <el-option v-for="item in truckTrip" :key="item.index" :value="item.id" :label="item.name" />
          </el-select>
        </el-form-item>
        <el-form-item label="选择车辆">
          <el-select v-model="formData.truckId" style="width:100%">
            <el-option v-for="item in truckData" :key="item.index" :value="item.id" :label="item.name" />
          </el-select>
        </el-form-item>
        <!-- <el-form-item label="选择车辆">
          <el-select v-model="formData.truckId" style="width:100%">
            <el-option v-for="item in truckData" :key="item.index" :value="item.id" :label="item.name" />
          </el-select>
        </el-form-item> -->
      </el-form>
      <template #footer>
        <el-button @click="close">取 消</el-button>
        <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
      </template>
    </el-dialog>
  </div>
</template>

<script>
export default {
  props: {
    showDialog: {
      type: Boolean,
      default: false
    },
    dialogData: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {
      formData: {
        id: null,
        transportNum: null,
        transportTripsId: null,
        truckId: null
      },
      truckData: [],
      truckTrip: [],
      rules: {

      }
    }
  },
  created() {
    this.formData.id = this.dialogData.id
    this.truckData = this.dialogData.transportOrderCount
    this.truckTrip = this.dialogData.transportTrips
    // this.formData.truckId = this.dialogData.truck.id
    this.formData.driverId = this.dialogData.drivers?.userId
  },
  methods: {
    close() {
      this.$emit('update:showDialog', false)
    }
  }
}

</script>

<style lang='scss' scoped>

</style>
